function [ p ] = getPositionProbabilities(graph, akPos, lastPos, lag, pmulti, p, pForward, pBack, pStay)
%% The function getPositionProbabilities find the possible positions and 
%% their probabilities for the bomber by a recursive function.
if lag > 0
    for i=1:length(graph)
       if graph(akPos,i) == 1
           if i == lastPos
               newpmulti = pmulti * pBack;
           elseif i ==akPos
               newpmulti = pmulti * pStay;
           else
               newpmulti = pmulti * pForward;
           end
           p = getPositionProbabilities(graph, i, akPos, lag-1, newpmulti, p, pForward, pBack, pStay);
       end
    end
else
    p(akPos) = p(akPos) + pmulti;
end


end

